<%@page language="java" pageEncoding="UTF-8"%>
<%@include file="/template/common/include/top.jsp"%>
<%@include file="/template/common/include/constant.jsp"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/template/js/gftuserfunc.js"></script>
<script language="javascript">
  var eles = [new Ele('id_u_userName',false,-1,-1,'用户名')];
</script>
<body>
  <div class="main1">当前的位置:用户管理&gt;&gt;用户编辑</div>
  <form method="post" action="${pageContext.request.contextPath}/gftuser.x" id="editFrm">
  ${sys_searchparemeter}
  <input type="hidden" id="id_op" name="op" value="updateUser" />
  <input type="hidden" name="u.id" value="${u.id}" />
  <input type="hidden" id="id_configId" name="configId" />
    <div class="edit_div">
    <table>
      <tr>
        <td>用户名:</td>
        <td><input type="text" id="id_u_userName" name="u.userName" value="${u.userName}" /></td>
      </tr>
      <tr>
        <td>密 码:</td>
        <td><input type="text" id="id_u_passWord" name="u.passWord" value="${u.passWord}" /></td>
      </tr>
      <tr>
        <td>用户类型:</td>
        <td>
          <select id="id_u_userType" name="u.userType">
            <option value="${user_admin}" <c:if test='${u.userType == user_admin}'>selected</c:if>>管理员</option>
            <option value="${user_normal}" <c:if test='${u.userType == user_normal}'>selected</c:if>>普通用户</option>
          </select>
        </td>
      </tr>
      <tr>
        <td>用户状态:</td>
        <td>
          <select id="id_u_status" name="u.status">
            <option value="${status_yes}" <c:if test='${u.status == status_yes}'>selected</c:if>>正常</option>
            <option value="${status_no}" <c:if test='${u.status == status_no}'>selected</c:if>>禁用</option>
          </select>
        </td>
      </tr>
    </table>
    <br />
    <table>
      <tr>
        <!--<th width="2%"></th>-->
        <th width="28%">角色名称</th>
        <th width="28%">角色描述</th>
        <th width="28%">角色状态</th>
        <th width="16%">操作</th>
      </tr>
      <c:forEach items="${roles}" var="row">
		<tr>
		  <div style="display:none"><input type="checkbox" name="roleid" value="${row.id}" /></div>
		  <td>${row.roleName}</td>
		  <td>${row.roleDesc}</td>
		  <td>
		    <c:choose>
		      <c:when test='${row.status == status_yes}'>正常</c:when>
		      <c:otherwise>禁用</c:otherwise>
		    </c:choose>
		  </td>
		  <td><a href="javascript:commit('editFrm',[['id_op','delUserRole'],['id_configId','${row.id}']]);" onclick="return confirm('是否要删除此条记录?')"><img src="<%=path%>/template/images/cz_1.gif" alt="删除" border="0"></a></td>
		</tr>
	  </c:forEach>
    </table>
    </div>
    <div class="edit_div">
      <input type="button" onclick="checkForm(eles,'editFrm');" value="确定" class="btn_Submit" />
      <c:if test="${not empty u.id}">
        <input type="button" onclick="selectRoles('${u.id}');" value="配置角色" class="btn_Submit" />
      </c:if>
      <input type="button" onclick="commit('editFrm',[['id_op','findUser']]);" value="返回" class="btn_Submit" />
    </div>
  </form>
</body>